<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Matlab绘图, 十二惊惶的gitee">
    <meta name="description" content="二维曲线plot函数：(1)plot函数的基本用法: plot(x,y)其中，x和y分别用于存储x坐标和y坐标数据。
%例一 绘制一条折线
x=[2.5,3.5,4,5];
y=[1.5,1,1.5];
plot(x,y)

(2)最简单的">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="referrer" content="no-referrer-when-downgrade">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>Matlab绘图 | 十二惊惶的gitee</title>
    <link rel="icon" type="image/png" href="/shier_jinghuang/favicon.png">
    


    <!-- bg-cover style     -->



<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/awesome/css/all.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/materialize/materialize.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/aos/aos.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/animate/animate.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/lightGallery/css/lightgallery.min.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/css/matery.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/css/my.css">
<link rel="stylesheet" type="text/css" href="/shier_jinghuang/css/dark.css" media="none" onload="if(media!='all')media='all'">




    <link rel="stylesheet" href="/shier_jinghuang/libs/tocbot/tocbot.css">
    <link rel="stylesheet" href="/shier_jinghuang/css/post.css">




    



    <script src="/shier_jinghuang/libs/jquery/jquery-3.6.0.min.js"></script>

<meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/shier_jinghuang/atom.xml" title="十二惊惶的gitee" type="application/atom+xml">
</head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/shier_jinghuang/" class="waves-effect waves-light">
                    
                    <img src="/shier_jinghuang/medias/1.jpg" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">十二惊惶的gitee</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/shier_jinghuang/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
  <li>
    <a href="javascript:;" class="waves-effect waves-light" onclick="switchNightMode()" title="深色/浅色模式" >
      <i id="sum-moon-icon" class="fas fa-sun" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/shier_jinghuang/medias/1.jpg" class="logo-img circle responsive-img">
        
        <div class="logo-name">十二惊惶的gitee</div>
        <div class="logo-desc">
            
            犁牛之子骍且角，虽欲勿用，山川其舍诸
            
        </div>
    </div>

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/shier_jinghuang/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://gitee.com/Im-so-scared-2/shier_jinghuang" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>十二惊惶
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://gitee.com/Im-so-scared-2/shier_jinghuang" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="十二惊惶" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/shier_jinghuang/medias/featureimages/11.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">Matlab绘图</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/shier_jinghuang/tags/%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/">
                                <span class="chip bg-color">学习记录</span>
                            </a>
                        
                            <a href="/shier_jinghuang/tags/Matlab/">
                                <span class="chip bg-color">Matlab</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/shier_jinghuang/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="post-category">
                                学习笔记
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2022-01-12
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2022-02-08
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    2.8k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    10 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/shier_jinghuang/libs/prism/prism.min.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="二维曲线"><a href="#二维曲线" class="headerlink" title="二维曲线"></a>二维曲线</h2><h3 id="plot函数："><a href="#plot函数：" class="headerlink" title="plot函数："></a>plot函数：</h3><p>(1)plot函数的基本用法: plot(x,y)其中，x和y分别用于存储x坐标和y坐标数据。</p>
<pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab"><span class="token comment">%例一 绘制一条折线</span>
x<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">2.5</span><span class="token punctuation">,</span><span class="token number">3.5</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">5</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
y<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1.5</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1.5</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token function">plot</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">)</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>

<p>(2)最简单的plot函数的调用格式： plot(x)   图形的横坐标，是x元素的索引。</p>
<pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab">y<span class="token operator">=</span><span class="token punctuation">[</span><span class="token number">1.5</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1.5</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token function">plot</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>

<p>当plot函数的参数x是复数向量时，则分别以该向量元素实部和虚部为横,纵坐标4绘制出一条曲线。</p>
<p>(3)plot(x,y)函数参数的变化形式</p>
<p>当x是向量，y是矩阵时</p>
<ol>
<li>如果矩阵y的列数等于x的长度，则以向量x为横坐标，以y的每个行向量为纵坐标绘制曲线，曲线的条数等于y的行数</li>
<li>如果矩阵y的行数等于x的长度，则以向量x为横坐标，以y的每个列向量为纵坐标绘制曲线，曲线的条数等于y的列数。</li>
</ol>
<p>当x、y是同型矩阵时</p>
<p>以x、y对应列元素为横、纵坐标分别绘制曲线，曲线条数等于矩阵的列数</p>
<p>(4)含多个输入参数plot函数plot(x1,y1,x2,y2,…,xn,yn)</p>
<p>其中，每一个向量对构成一组数据点的横、纵坐标，绘制一条曲线。</p>
<p>(5)含选项的plot函数  plot(x,y,选项)</p>
<p><img src="https://shierjinghuang.github.io/2022/01/10/Matlab/20.png"></p>
<h3 id="fplot函数："><a href="#fplot函数：" class="headerlink" title="fplot函数："></a>fplot函数：</h3><p><strong>x往往采取等间隔采样，如果在函数随着自变量的变化未知或者在不同区间的函数频率特性差别大，如果采用<code>plot</code>函数时自变量的采样间隔设置不合理，则无法反映函数的变化趋势。</strong></p>
<p>如何解决这个问题呢？<strong>——<code>fplot</code>可根据参数函数的变化特性，自适应地设置采样间隔。</strong></p>
<p>(1)fplot函数的基本用法：  fplot(f,lims,选项)</p>
<p>其中，f代表一个函数，通常采用函数句柄的形式。lims为x轴的取值范围，用二元向量[xmin,xmax]描述，默认值为[-5,5]。选项定义与plot函数相同。</p>
<p>(2）双输入函数参数的用法       fplot(funx, funy, tlims,选项)<br>其中，funx、funy代表函数，通常采用函数句柄的形式。tlims为参数函数funx和funy的自变量的取值范围，用二元向量[tmin，tmax]描述。</p>
<h2 id="绘制图形的辅助操作"><a href="#绘制图形的辅助操作" class="headerlink" title="绘制图形的辅助操作"></a>绘制图形的辅助操作</h2><h3 id="给图形添加标注"><a href="#给图形添加标注" class="headerlink" title="给图形添加标注"></a>给图形添加标注</h3><ol>
<li><p>title函数</p>
<ul>
<li><p>title函数的基本用法：   title(图形标题)</p>
</li>
<li><p>在图形标题中使用Latex格式控制符：   <strong>\bf 加粗  \it 斜体  \rm  整体</strong></p>
</li>
<li><p>含属性设置的title函数   title(图形标题,属性名,属性值)</p>
<p>Color属性：用于设置图形标题文本的颜色。</p>
<p>FontSize属性： 用于设置标题文字的字号。</p>
</li>
</ul>
</li>
<li><p>xlabel函数和ylabel函数    xlabel(x轴说明)     ylable(y轴说明)</p>
</li>
<li><p>text函数和gtext函数：  </p>
<p>text(x,y,说明)     gtext(说明)</p>
<p><code>gtext</code>函数没有坐标参数，执行命令时，十字光标跟随鼠标移动，单击鼠标，即可将说明放置在十字光标处。</p>
</li>
<li><p>legend函数      legend(图例1,图例2,…)</p>
</li>
</ol>
<h3 id="坐标控制"><a href="#坐标控制" class="headerlink" title="坐标控制"></a>坐标控制</h3><ol>
<li><p>axis函数</p>
<ul>
<li><p>axis([xmin,xmax,ymin,ymax,zmin,zmax])</p>
</li>
<li><p>axis的其他用法：</p>
<p>axis equal:  纵、横坐标采用等长刻度       axis square:   产生正方形坐标系(默认为矩形)   </p>
<p>axis auto:    使用默认设置     axis off：    取消坐标轴       axis on：  显示坐标轴</p>
<p><code>axis equal</code>后，如：x轴0到1长度等于y轴0到1长度。消除因为x轴和y轴刻度长不等带来的图像变形。</p>
</li>
</ul>
</li>
<li><p>给坐标系加网格和边框(grid)</p>
<p>grid on:控制显示网格线     grid off:控制不显示网格线     grid:在两种状态之间进行切换</p>
<p>box函数   box on,box off,box。用法同grid。</p>
</li>
<li><p>图形保持(hold)</p>
<p>在已经存在的图形叠加图形</p>
<pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab">hold on   <span class="token comment">% 控制保持原有图形</span>
hold off  <span class="token comment">% 控制刷新图形窗口</span>
hold      <span class="token comment">% 两种模式间切换</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre></li>
<li><p>d 图形窗口的分割(subplot)</p>
<p>子图：同一图形窗口中的不同坐标系下的图形称为子图。</p>
<p>subplot函数： subplot(m,n,p)  其中，m,n指定将图形窗口分成m * n个绘图区，p指定当前活动区。</p>
</li>
</ol>
<pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab">x<span class="token operator">=</span><span class="token function">linspace</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token operator">*</span><span class="token keyword">pi</span><span class="token punctuation">,</span><span class="token number">60</span><span class="token punctuation">)</span><span class="token operator">:</span>
<span class="token function">subplot</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token comment">%将整个坐标图分成两行两列，按行数的第一个子图</span>
<span class="token function">plot</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span><span class="token function">sin</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">title</span><span class="token punctuation">(</span><span class="token string">'sin(x)-1'</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token function">axis</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token operator">*</span><span class="token keyword">pi</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token function">subplot</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span> <span class="token comment">%将整个坐标图分成两行1列，按行数的第2个子图</span>
<span class="token function">plot</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span><span class="token function">cos</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">title</span><span class="token punctuation">(</span><span class="token string">'cos(x)+1'</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token function">axis</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token operator">*</span><span class="token keyword">pi</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token function">subplot</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">)</span> <span class="token comment">%将整个坐标图分成4行4列，按行数的第3个子图</span>
<span class="token function">plot</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span><span class="token function">tan</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">title</span><span class="token punctuation">(</span><span class="token string">'tan(x)'</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token function">axis</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token operator">*</span><span class="token keyword">pi</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">40</span><span class="token punctuation">,</span><span class="token number">40</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
<span class="token function">subplot</span><span class="token punctuation">(</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">)</span> <span class="token comment">%将整个坐标图分成4行4列，按行数的第8个子图</span>
<span class="token function">plot</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span><span class="token function">cot</span><span class="token punctuation">(</span>x<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">title</span><span class="token punctuation">(</span><span class="token string">'cot(x)'</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token function">axis</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token operator">*</span><span class="token keyword">pi</span><span class="token punctuation">,</span><span class="token operator">-</span><span class="token number">35</span><span class="token punctuation">,</span><span class="token number">35</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>

<p><img src="https://shierjinghuang.github.io/2022/01/10/Matlab/22.png"></p>
<h2 id="其他形式的二维图形"><a href="#其他形式的二维图形" class="headerlink" title="其他形式的二维图形"></a>其他形式的二维图形</h2><h3 id="其他坐标系下的二维曲线图"><a href="#其他坐标系下的二维曲线图" class="headerlink" title="其他坐标系下的二维曲线图"></a>其他坐标系下的二维曲线图</h3><ol>
<li><p>对数坐标图(semilogx;semilogy;loglog)</p>
<p>semilogx: x使用常用对数刻度,y为线性刻度</p>
<p>semilogy: y使用常用对数刻度,x为线性刻度</p>
<p>loglog:x,y都使用常用对数刻度</p>
</li>
<li><p>极坐标图(polar)</p>
<pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab"><span class="token function">polar</span><span class="token punctuation">(</span>theta<span class="token punctuation">,</span>rho<span class="token punctuation">,</span>选项<span class="token punctuation">)</span> <span class="token comment">%其中,theta为极角，rho为极径，选项的内容与plot函数相同。</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre></li>
</ol>
<h3 id="统计图"><a href="#统计图" class="headerlink" title="统计图"></a>统计图</h3><ol>
<li><p>条形类图形（bar、barh；hist、rose）</p>
<p>条形图：</p>
<p>bar函数:    竖直条形图，bar(y,style)其中y是数据,选项style用于指定分组排列模式。grouped簇状分组，stacked堆积分组。   bar(x,y,style)其中，x存储横坐标，y存储数据</p>
<p>barh函数:水平条形图   使用方式与bar函数类型</p>
<p>直方图：</p>
<p>hist函数:直角坐标系 </p>
<p>hist(y)，hist(y,x)其中，参数y是要统计的数据，x用于指定区间的划分方式。</p>
<p>x:用于设置统计区间的划分方式，若统计数据为标量，则统计数据均分为x个小区间，若x是向量，则x中的每一个数指定分组的中心值，元素的个数为数据分组数，x缺省时，默认按10个等分区间进行统计。</p>
<p>rose函数:极坐标系</p>
<p>rose(theta,x) 其中，参数theta用于确定每一区间与原点的角度，选项x用于指定区间的划分方式。</p>
<p>theta:是一个向量，绘图时将圆划分为若干个角度相等的扇形区域，每个扇形高度为落入这个扇形区域的theta个数。如果x是标量，则将0到2pi划分为x个扇形区域，默认20。</p>
<pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab"><span class="token comment">%  绘制高斯分布数据在极坐标下的直方图。</span>
y<span class="token operator">=</span><span class="token function">randn</span><span class="token punctuation">(</span><span class="token number">500</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
theta<span class="token operator">=</span>y<span class="token operator">*</span><span class="token keyword">pi</span><span class="token punctuation">;</span>
<span class="token function">rose</span><span class="token punctuation">(</span>theta<span class="token punctuation">)</span>
<span class="token function">title</span><span class="token punctuation">(</span>"在极坐标下的直方图"<span class="token punctuation">)</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre></li>
<li><p>面积类图形（pie;area）</p>
<ul>
<li><p>1扇形图 pie函数  pie(x,explode)</p>
<p>其中，参数x存储待统计数据，选项explode控制图块的显示模式</p>
</li>
<li><p>2面积图 area函数 area(x, y)：</p>
<p>该函数以参数x和y绘制面积图。如果x和y为向量，则相当于函数plot(x, y)，并将0到y之间进行了填充。如果参数y为矩阵，则将y的每一列绘制面积图并进行叠加。</p>
</li>
</ul>
</li>
<li><p>散点类图形（scatter;stairs;stem）</p>
<ul>
<li><p>scatter函数： 散点图</p>
<p>scatter(x,y,选项,’filled’)参数x,y用于定位数据点，选项用于指定线型，颜色，数据点标记。</p>
<p><strong>filed:填充数据点标记</strong></p>
</li>
<li><p>stairs函数： 阶梯图</p>
</li>
<li><p>stem函数： 杆图</p>
</li>
</ul>
</li>
</ol>
<h3 id="矢量图形-compass-feather-quiver"><a href="#矢量图形-compass-feather-quiver" class="headerlink" title="矢量图形(compass;feather;quiver)"></a>矢量图形(compass;feather;quiver)</h3><p><img src="https://shierjinghuang.github.io/2022/01/10/Matlab/23.png"></p>
<ol>
<li><p><strong>compass：</strong><br><code>compass(x,y)</code>：x,y是n维向量，显示n个箭头，箭头的起点为原点，箭头位置为（x(i),y(i)）.<br><code>compazz(z)</code>:参量z为n维复数向量，命令显示n个箭头，箭头起点为原点，箭头位置为（real(z),image(z)）。</p>
</li>
<li><p><strong>feather：</strong><br>feather(x,y) :函数绘制由向量参量x与y构成的速度向量，沿水平轴方向，从均匀间隔点以箭头发射出来<br>feather(z) :函数绘制羽毛图。参量z是一个复数，则feather(z)相当于compass(real(z)，imag(z))；</p>
</li>
<li><p><strong>quiver函数调用格式:</strong></p>
<p>quiver(x, y, u, v)其中，(x, y)指定矢量起点，(u, v)指定矢量终点。</p>
</li>
</ol>
<h2 id="三维曲线"><a href="#三维曲线" class="headerlink" title="三维曲线"></a>三维曲线</h2><h3 id="plot3函数"><a href="#plot3函数" class="headerlink" title="plot3函数"></a>plot3函数</h3><p>(1)plot3函数的基本用法：plot3(x,y,z)其中，参数x、y、z组成一组曲线的坐标。</p>
<p>(2)含多组输入参数的plot3函数： plot3(x1,y1,z1,x2,y2,z2,…,xn,yn,zn)</p>
<p>每一组x,y,z向量构成 一组数据点的坐标，绘制一条曲线</p>
<p>(3)含选项的plot3函数： 选项用于指定曲线的线型，颜色和数据点标记。</p>
<h3 id="fplot3函数"><a href="#fplot3函数" class="headerlink" title="fplot3函数"></a>fplot3函数</h3><pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab"><span class="token function">fplot3</span><span class="token punctuation">(</span>funx<span class="token punctuation">,</span>funy<span class="token punctuation">,</span>funz<span class="token punctuation">,</span>tlims<span class="token punctuation">)</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>

<p>其中,funx、funy、funz代表定义曲线x、y、z坐标的函数，通常采用函数句柄的形式。tlims为参数函数自变量的取值范围，用二元向量[tmin，tmax]描述﹐默认为[-5，5]。</p>
<h2 id="三维曲面"><a href="#三维曲面" class="headerlink" title="三维曲面"></a>三维曲面</h2><h3 id="平面网格数据的生成"><a href="#平面网格数据的生成" class="headerlink" title="平面网格数据的生成"></a>平面网格数据的生成</h3><p>(1)利用矩阵运算生成</p>
<p>(2)利用meshgrid函数生成，[X,Y]=meshgrid(x,y)；其中，参数x、y为向量，存储网格的X，Y为矩阵</p>
<h3 id="绘制三维曲面的mesh函数和surf函数"><a href="#绘制三维曲面的mesh函数和surf函数" class="headerlink" title="绘制三维曲面的mesh函数和surf函数"></a>绘制三维曲面的mesh函数和surf函数</h3><ol>
<li>基本调用格式</li>
</ol>
<pre class="line-numbers language-matlab" data-language="matlab"><code class="language-matlab"><span class="token function">mesh</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>z<span class="token punctuation">,</span>c<span class="token punctuation">)</span>
<span class="token function">surf</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span>z<span class="token punctuation">,</span>c<span class="token punctuation">)</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>

<p>其中x、y是网络坐标矩阵，z是网格点上的该网格点上的高度矩阵，c用于指定在不同高度下的曲面颜色。</p>
<ol start="2">
<li>其他调用格式:  mesh(z,c)  surf(z,c) </li>
</ol>
<p>当x,y省略时，z矩阵的第2维下标当作x轴坐标，z矩阵的第1维下标当作y轴坐标。</p>
<ul>
<li>带等高线的三维网格曲面函数meshc</li>
<li>带底座的三维网格曲面函数meshz</li>
<li>具有等高线的曲面函数surfc</li>
<li>具有光照效果的曲面函数surfl</li>
</ul>
<h3 id="标准三维曲面（sphere-cylinder；peaks）"><a href="#标准三维曲面（sphere-cylinder；peaks）" class="headerlink" title="标准三维曲面（sphere;cylinder；peaks）"></a>标准三维曲面（sphere;cylinder；peaks）</h3><p>(1) sphere函数 [x,y,z]=sphere(n)</p>
<p>(2)cylinder函数 [x,y,z]=cylinder(R,n)</p>
<p>面和柱面。<br>sphere将产生3个n+1阶的方阵，可以绘制出圆心位于原点，半径为1的单位球体，如果调用该函数时，不带输出参数，则直接绘制球面，n决定球面圆滑程度，默认20，n越大，越光滑。<br>cyinder函数的R是一个向量，<strong>存放柱面各个等间隔高度上的半径</strong>，n表示在圆柱圆周上有n个间隔点，默认20个，n越大，越滑。如果R是一个标量，则生成一个圆柱面。</p>
<p>(3)peaks函数 </p>
<p><img src="D:\blog\shierjinghuang\source_posts\Matlab\24.png"></p>
<p>peak(n):参数为一个标量，生成n阶方阵<br>peaks(V)、peaks(x,y):若参数为向量或网格矩阵代入$f(x,y)$,计算得到高度矩阵，用peaks生成的矩阵，可以用于mesh、surf的参数绘制多峰函数曲面图。</p>
<h3 id="fsurf函数和fmesh函数"><a href="#fsurf函数和fmesh函数" class="headerlink" title="fsurf函数和fmesh函数"></a>fsurf函数和fmesh函数</h3><h2 id="图形修饰处理"><a href="#图形修饰处理" class="headerlink" title="图形修饰处理"></a>图形修饰处理</h2><h3 id="视点处理-view"><a href="#视点处理-view" class="headerlink" title="视点处理(view)"></a>视点处理(view)</h3><p>视点可由方位角和仰角表示。</p>
<h3 id="色彩处理-colormap；shading"><a href="#色彩处理-colormap；shading" class="headerlink" title="色彩处理(colormap；shading)"></a>色彩处理(colormap；shading)</h3><ol>
<li>颜色的向量(RGB)表示：[0 0 1]:蓝色 ，[1 0 0]:红色 ， [0 1 0]:绿色 []</li>
<li>色图:(Colormap)</li>
</ol>
<h3 id="图形的裁剪处理"><a href="#图形的裁剪处理" class="headerlink" title="图形的裁剪处理"></a>图形的裁剪处理</h3><p>将图形中需要裁剪部分对应的函数值设置成NaN，这样在绘制图形时，函数值为NaN的部分将不显示出来,从而达到对图形进行裁剪的目的。</p>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/shier_jinghuang/about" rel="external nofollow noreferrer">十二惊惶</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://im-so-scared-2.gitee.io/shier_jinghuang/shier_jinghuang/2022/01/12/Matlab%E4%B9%8B%E5%9B%BE%E5%83%8F%E7%BB%98%E5%88%B6/">https://im-so-scared-2.gitee.io/shier_jinghuang/shier_jinghuang/2022/01/12/Matlab%E4%B9%8B%E5%9B%BE%E5%83%8F%E7%BB%98%E5%88%B6/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/shier_jinghuang/about" target="_blank">十二惊惶</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/shier_jinghuang/tags/%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/">
                                    <span class="chip bg-color">学习记录</span>
                                </a>
                            
                                <a href="/shier_jinghuang/tags/Matlab/">
                                    <span class="chip bg-color">Matlab</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/shier_jinghuang/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/shier_jinghuang/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/shier_jinghuang/2022/01/16/Matlab%E7%AC%A6%E5%8F%B7%E8%BF%90%E7%AE%97/">
                    <div class="card-image">
                        
                        
                        <img src="/shier_jinghuang/medias/featureimages/19.jpg" class="responsive-img" alt="Matlab符号运算">
                        
                        <span class="card-title">Matlab符号运算</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2022-01-16
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shier_jinghuang/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="post-category">
                                    学习笔记
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shier_jinghuang/tags/%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/">
                        <span class="chip bg-color">学习记录</span>
                    </a>
                    
                    <a href="/shier_jinghuang/tags/Matlab/">
                        <span class="chip bg-color">Matlab</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/shier_jinghuang/2022/01/12/Matlab2/">
                    <div class="card-image">
                        
                        
                        <img src="/shier_jinghuang/medias/featureimages/11.jpg" class="responsive-img" alt="Matlab入门(二)">
                        
                        <span class="card-title">Matlab入门(二)</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2022-01-12
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/shier_jinghuang/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="post-category">
                                    学习笔记
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/shier_jinghuang/tags/%E5%AD%A6%E4%B9%A0%E8%AE%B0%E5%BD%95/">
                        <span class="chip bg-color">学习记录</span>
                    </a>
                    
                    <a href="/shier_jinghuang/tags/Matlab/">
                        <span class="chip bg-color">Matlab</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeBlockFuction.js"></script>


  <!-- 是否加载使用自带的 prismjs. -->
  <script type="text/javascript" src="/shier_jinghuang/libs/prism/prism.min.js"></script>


<!-- 代码语言 -->

<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/shier_jinghuang/libs/codeBlock/codeShrink.js"></script>



    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/shier_jinghuang/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/shier_jinghuang/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="503838841"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/shier_jinghuang/libs/aplayer/APlayer.min.js"></script>
<script src="/shier_jinghuang/libs/aplayer/Meting.min.js"></script>

    

    <div class="container row center-align"
         style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2019-2023</span>
            
            <a href="/shier_jinghuang/about" target="_blank">十二惊惶</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
                &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                        class="white-color">289.6k</span>
            
            
            
                
            
            
                <span id="busuanzi_container_site_pv">
                &nbsp;|&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;
                    <span id="busuanzi_value_site_pv" class="white-color"></span>
            </span>
            
            
                <span id="busuanzi_container_site_uv">
                &nbsp;|&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;
                    <span id="busuanzi_value_site_uv" class="white-color"></span>
            </span>
            
            <br>

            <!-- 运行天数提醒. -->
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/blinkfox" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1181062873@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1181062873" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1181062873" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/shier_jinghuang/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/shier_jinghuang/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 白天和黑夜主题 -->
<div class="stars-con">
    <div id="stars"></div>
    <div id="stars2"></div>
    <div id="stars3"></div>  
</div>

<script>
    function switchNightMode() {
        $('<div class="Cuteen_DarkSky"><div class="Cuteen_DarkPlanet"></div></div>').appendTo($('body')),
        setTimeout(function () {
            $('body').hasClass('DarkMode') 
            ? ($('body').removeClass('DarkMode'), localStorage.setItem('isDark', '0'), $('#sum-moon-icon').removeClass("fa-sun").addClass('fa-moon')) 
            : ($('body').addClass('DarkMode'), localStorage.setItem('isDark', '1'), $('#sum-moon-icon').addClass("fa-sun").removeClass('fa-moon')),
            
            setTimeout(function () {
            $('.Cuteen_DarkSky').fadeOut(1e3, function () {
                $(this).remove()
            })
            }, 2e3)
        })
    }
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/shier_jinghuang/libs/materialize/materialize.min.js"></script>
    <script src="/shier_jinghuang/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/shier_jinghuang/libs/aos/aos.js"></script>
    <script src="/shier_jinghuang/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/shier_jinghuang/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/shier_jinghuang/js/matery.js"></script>

    

    

    <!-- 雪花特效 -->
    

    <!-- 鼠标星星特效 -->
    

     
        <script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>
        <script src="/shier_jinghuang/libs/others/TencentCaptcha.js"></script>
        <button id="TencentCaptcha" data-appid="xxxxxxxxxx" data-cbfn="callback" type="button" hidden></button>
    

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/shier_jinghuang/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/shier_jinghuang/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/shier_jinghuang/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
